home *** CD-ROM | disk | FTP | other *** search
/ HPAVC / HPAVC CD-ROM.iso / DEVELOP.ZIP / DIRIDX.DOC < prev    next >
Text File  |  1994-08-13  |  2KB  |  35 lines

  1. The following information describes the IDX files that are associated with
  2. DIR files.  These IDX files are NOT related in any way to the IDX files that
  3. are used inside of DLPATH.LST.  The two index files serve completely different
  4. purposes and both of them are highly desirable.
  5.  
  6.   typedef struct {
  7.     long     FileSize;
  8.     unsigned FileTime;
  9.     unsigned FileDate;          <-- file date using DOS's bit-packed date
  10.     unsigned Latest;            <-- file date of the most recent file in index
  11.     char     Reserved[6];
  12.   } idxheadertype;
  13.  
  14.   typedef struct {
  15.     char     Name[NAMESIZE];     <-- 8 bytes
  16.     char     Ext[EXTSIZE];       <-- 3 bytes
  17.     unsigned Date;               <-- file date using DOS's bit-packed date
  18.     unsigned LoOffset;           /
  19.     char     HiOffset;           \ these two fields make a 3-byte-integer
  20.   } filetype;
  21.  
  22. The header is used to determine if the IDX file is out of sync and needs to be
  23. recreated.  The only thing unusual about the IDX records is the use of a
  24. LoOffset and HiOffset.  This is a 3-Byte Integer (as opposed to a 2 byte short
  25. integer or a 4 byte long integer).  The 3-Byte Integer pretty well covers the
  26. maximum expected size of a DIR file (over 17M in size) and saving the extra
  27. byte keeps the record size at 16 bytes (I hate non-binary sized records and
  28. cringed at the thought of using 17 bytes per record, besides, reading the
  29. IDX file in hex mode using a program such as Vern Buerg's LIST is a lot easier
  30. and prettier with the record kept to 16 bytes).
  31.  
  32. In the header the "Latest" field is used so that when PCBoard is searching for
  33. new files, it can completely skip over (without even reading beyond the header)
  34. those IDX files that have older files listed in them.
  35.